export const showRecordButton = state => {
  const {
    currentRecordIsFinish,
    currentPlayState,
    upload_audio = "",
    recordPath = "",
    isRecording
  } = state;
  console.log(
    currentRecordIsFinish,
    currentPlayState,
    upload_audio,
    recordPath,
    isRecording
  );
  console.log(
    (currentRecordIsFinish && (upload_audio || recordPath)) || // 存在自录音 不播放正文
    (currentRecordIsFinish && currentPlayState === "") || // 下一段文章播放完
      (!currentRecordIsFinish && currentPlayState === "voice") // 播放自录音的时候可以 直接去录音
  );
  return (
    (currentRecordIsFinish && (upload_audio || recordPath)) || // 存在自录音 不播放正文
    (currentRecordIsFinish && currentPlayState === "") || // 下一段文章播放完
    (!currentRecordIsFinish && currentPlayState === "voice") // 播放自录音的时候可以 直接去录音
  );
};

export const showNextButton = state => {
  const {
    currentPlayState,
    currentRecordIsFinish,
    recordPath = "",
    upload_audio = "",
    isRecording
  } = state;
  return (
    (currentPlayState === "voice" || currentRecordIsFinish) && // 当前没有 声音播放 或则 上一个 播放声音的 种类是 voice
    (recordPath || upload_audio) && // 存在 一个 可以 播放的录音
    !isRecording // 没有录音
  );
};
